<template>
	<view class="">
		<view class="">
			<!-- 2.0.19支持autoBack，默认为false -->
			<u-navbar leftText="邻里共享" leftIcon="share" bgColor="#0B868E">
			</u-navbar>
		</view>

		<view class="con-body wrap">
			<view style="height: 20rpx;"></view>
			<u-swiper :list="bannerList" @change="change" previousMargin="20" nextMargin="20" @click="click" radius="8"
				:indicator="true" style="margin-top: 20rpx;"></u-swiper>

			<view style="background-color: #F8F8F8; border-radius: 15rpx;padding-bottom: 20rpx; margin-top: 20rpx;
			box-shadow: 5rpx 5rpx 20rpx rgba(0, 0, 0, 0.15);">
				<u-grid :border="false" @click="click" col="4">
					<u-grid-item v-for="(item,index) in nav" :key="index">
						<u-icon :customStyle="{paddingTop:20+'rpx'}" @click="navInto(index)" :name="item.thumb"
							:width="60" :height="60" style="border-radius: 20rpx;" :label="item.title" labelPos="bottom"
							labelColor="#363636" space="8" labelSize="14">
						</u-icon>
					</u-grid-item>
				</u-grid>

				<u-toast ref="uToast" />
			</view>
			<!-- 热门推荐 -->
			<view class="uni-flex-center" style="margin-top: 15rpx;">
				<view class="main-service uni-cell-90">
					<view class="title">热门推荐<text
							style="color: #999999; font-weight: 400;font-size: 28rpx; float: right; padding-right: 20rpx;">更多</text>
					</view>
					<view class="user-list">
						<view class="user-list-cell">
							<view class="u-demo-block__content">
								<u-row customStyle="margin-bottom: 10px">
									<u-col span="5.8">
										<view class="demo-layout">
											<u-image :src="hotService[0].image" width="100%" height="200rpx"
												mode="scaleToFill" @click="freeCare">
											</u-image>
										</view>
									</u-col>
									<u-col span="0.4"></u-col>
									<u-col span="5.8">
										<view class="demo-layout">
											<u-image :src="hotService[1].image" width="100%" height="200rpx"
												mode="scaleToFill" @click="workHelp">
											</u-image>
										</view>
									</u-col>
								</u-row>
								<u-row customStyle="margin-bottom: 10px">
									<u-col span="12">
										<view class="demo-layout">
											<u-image :src="hotService[2].image" width="100%" height="200rpx"
												mode="scaleToFill" @click="lattice">
											</u-image>
										</view>
									</u-col>
								</u-row>
								<u-row justify="space-between" style="background-color: #EEEEEE;">
									<u-col span="2">
										<view class="demo-layout"
											style="height: 165rpx; background-color: #126970;text-align: right; border-top-right-radius: 20rpx; border-bottom-right-radius: 20rpx; padding-top: 10rpx;">
											<text
												style="font-size: 32rpx; color: #FFFFFF; margin-left: 35rpx; padding-right: 40rpx;">热</text>
											<text
												style="font-size: 32rpx; color: #FFFFFF; margin-left: 35rpx; padding-right: 40rpx;">门</text>
											<text
												style="font-size: 32rpx; color: #FFFFFF; margin-left: 35rpx; padding-right: 40rpx;">共</text>
											<text
												style="font-size: 32rpx; color: #FFFFFF; margin-left: 35rpx; padding-right: 40rpx;">享</text>
										</view>
									</u-col>
									<u-col span="10">
										<view class="demo-layout">
											<text v-for="(item, index) in hotShare"
												style="word-wrap: break-word;
							word-break: normal; font-size: 30rpx;  color: #126970; line-height: 80rpx; margin-left: 4%; padding: 10rpx 3%; border: 1rpx solid #126970; border-radius: 50rpx;">
												<text>{{item.name}}</text>
											</text>
										</view>
									</u-col>
								</u-row>
							</view>
						</view>
					</view>
				</view>
			</view>

			<!-- 共享厨房 -->
			<view class="uni-flex-center" style="margin-top: 15rpx;">
				<view class="main-service uni-cell-90">
					<view class="title">共享厨房</view>
					<view class="user-list">
						<view class="user-list-cell">
							<view style="width: 100%; height: 265rpx;" @click="kitchen">
								<u-image src="https://s4.ax1x.com/2022/02/17/H5aAWn.png" mode="widthFix" width="100%"
									height="265rpx"></u-image>
							</view>
						</view>
					</view>
				</view>
			</view>


		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bannerList: [
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				],
				nav: [{
					thumb: "https://s4.ax1x.com/2022/03/03/bY2H9f.png",
					title: "四点半课堂"
				}, {
					thumb: "https://s4.ax1x.com/2022/03/03/bY2T4P.png",
					title: "共享格子铺"
				}, {
					thumb: "https://s4.ax1x.com/2022/03/03/bY2oNt.png",
					title: "共享便民"
				}, {
					thumb: "https://s4.ax1x.com/2022/03/03/bY2b38.png",
					title: "共享养老"
				}],
				hotService: [{
						name: '免费看护',
						image: 'https://s4.ax1x.com/2022/02/17/H519Zn.png'
					},
					{
						name: '作业辅导',
						image: 'https://s4.ax1x.com/2022/02/17/H51Sqs.png'
					},
					{
						name: '共享格子铺',
						image: 'https://s4.ax1x.com/2022/02/17/H53wnJ.png'
					}
				],
				hotShare: [{
						name: '母婴用品'
					},
					{
						name: '玩具书籍'
					},
					{
						name: '家电数码'
					},
					{
						name: '车位出租'
					},
					{
						name: '家居收纳'
					},
					{
						name: '其他物品'
					}
				]
			}
		},
		methods: {
			navInto(index) {
				switch (index) {
					case 0:
						this.$u.route({
							url: '/pagesShare/schoole/index',
							params: {

							}
						});
						break;
					case 1:
						this.$u.route({
							url: '/pagesShare/lattice/index',
							params: {

							}
						});
						break;
					case 2:
						this.$u.route({
							url: '/pagesShare/tool/index',
							params: {

							}
						});
						break;
					case 3:
						this.$u.route({
							url: '/pagesShare/yanglao/index',
							params: {

							}
						});
						break;
					default:
						console.log('暂不支持');
				}
			},
			kitchen() {
				this.$u.route({
					url: '/pagesShare/kitchen/index',
					params: {

					}
				});
			},
			freeCare(){
				this.$u.route({
					url: '/pagesShare/schoole/join',
					params: {
				
					}
				});
			},
			workHelp(){
				this.$u.route({
					url: '/pagesShare/schoole/join',
					params: {
				
					}
				});
			},
			lattice(){
				this.$u.route({
					url: '/pagesShare/lattice/index',
					params: {
				
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	.wrap {
		width: 96%;
		margin-left: 2%;
		margin-bottom: 44rpx;
	}

	.scroll-list {
		margin-left: 20rpx;
		@include flex(column);

		&__goods-item {
			margin-right: 20rpx;

			&__image {
				width: 86px;
				height: 65px;
				border-radius: 4px;
			}

			&__text {
				color: #126970;
				text-align: center;
				font-size: 12px;
				margin-top: 5px;
			}
		}

		&__show-more {
			background-color: #fff0f0;
			border-radius: 3px;
			padding: 3px 6px;
			@include flex(column);
			align-items: center;

			&__text {
				font-size: 12px;
				width: 12px;
				color: #f56c6c;
				line-height: 16px;
			}
		}
	}
</style>
